//************************************************
// File Name: Level0ViewController.m
// Team: Team Epsilon
// Date Created: 2009/07/01
// Purpose: The Tutorial Level of the adventure mode. 
// Change History: 
//   * James, Date: 2009/06/18 Create File
//   * James, Date: 2009/06/20 Adding Controller
//   * James, Date: 2009/06/24 Adding timer
//   * James, Date: 2009/07/01 Adding Objects
//   * James, Date: 2009/07/01 Adding Comments
//   * James, Date: 2009/07/13 Adding variable to fix movement bugs
//   * Shanna, Date: 2009/07/15 Movement bug fix
//   * JJ, Date: 2009/07/15 Movement buy fix
//   * Mark, Date: 2009/07/15 Major Movement bug fix
//   * JJ, Date: 2009/07/15 Movement buy fix
//   * James, Date: 2009/07/16 Adding comment
//************************************************

#import <UIKit/UIKit.h>

// interface controller
@interface Level0ViewController : UIViewController 
{

		UIAlertView *usageAlertView;
		BOOL showUsageAlert;
		
		// the timer part starts
		IBOutlet UILabel *countdownLabel;
		IBOutlet UILabel *msgLabel;
		int iniSec;
	
		int score0;
		
		BOOL timeUP;
		
		BOOL gameIsPlaying;
		
		int alertFlag;
				
		NSTimer *timer;
		
		//players
		IBOutlet UIImageView *water1;
		IBOutlet UIImageView *fire1;
		IBOutlet UIImageView *fire2;
		IBOutlet UIImageView *grass1;// added this
		
		//player start position
		IBOutlet UIImageView *water1_stpos;
		IBOutlet UIImageView *fire1_stpos;
		IBOutlet UIImageView *fire2_stpos;
		IBOutlet UIImageView *grass1_stpos;
				
		//initial positions;
		CGPoint water1_cord;
		CGPoint fire1_cord;
		CGPoint fire2_cord;
		CGPoint grass1_cord;
		
		//last positions recorder;
		CGPoint last_water1_cord;
		CGPoint last_fire1_cord;
		CGPoint last_fire2_cord;
		CGPoint last_grass1_cord;
		CGPoint offScreenPoint;
		
		//initial position for checking where it can be moved
		CGPoint water1_stpos_cord;
		CGPoint fire1_stpos_cord;
		CGPoint fire2_stpos_cord;
		CGPoint grass1_stpos_cord;
	
		//current position of the element in the node
		CGPoint water1_curr_cord;
		CGPoint fire1_curr_cord;
		CGPoint fire2_curr_cord;
		CGPoint grass1_curr_cord;						

		int kills;
		
		BOOL isWin;
}

// Action for interface builder
// Action for login button
- (IBAction) loginx:(id)sender;

// Action for go to the next level
- (IBAction) nextlevel:(id)sender;
	
// timer starts
// set the initial time
-(void)setIniTime;

//update the time
-(void)updateLabel;

// do something after time's up
-(IBAction)doSomething:(id)sender;

// action for start the game
- (IBAction) startCount:(id)sender;

// timer initial time in miliseconds
@property int iniSec;

//boolean to check if time's up
@property BOOL timeUP;

// boolean to check if the game is still playing
@property BOOL gameIsPlaying;
// timer ends

@property int score0;

// using the buildin popup window	
@property (nonatomic, retain) UIAlertView *usageAlertView;

// show the buildin popup window
@property BOOL showUsageAlert;

// the flag for alert to show
@property int alertFlag;
	
@end
	
